const router = require("koa-router")();
const banner = require("../data/banner");
const top250 = require("../data/top250");
router.get("/api/banner",async ctx=>{
    ctx.body = banner
})
router.get("/api/top250",async ctx=>{
    ctx.body = top250
})
router.get("/api/subject",async ctx=>{
    console.log(ctx.request.query);
    var {id} = ctx.request.query;
    var item = top250.find(item=>{
        return item._id==id;
    })
    console.log(item);
    ctx.body = item;
})
module.exports  = router;